<template>
  <div>
    <input type="text" v-model="title">
    <button @click="add">添加</button>
  </div>
</template>

<script>
import eventBus from '@/event/eventBus.js'

export default {
   data(){
    return{
      title:''
    }
  },
  methods:{
    add(){
      this.$emit('add',this.title)
      eventBus.$emit('addItem',this.title)
    }
  },
  mounted:{

  },
  created:{

  }
}
</script>